package model;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import javax.persistence.FetchType;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="student")
public class Student {

    private int id;
    private boolean is_captain;
    private String first_name;
    private String last_name;
    private Group group;
    private  Chair chair;

    @Id
    @GeneratedValue(generator="increment")
    @GenericGenerator(name = "increment", strategy = "increment")
    @Column(name="id")
    public  int  getId(){
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "is_captain")
    public boolean getIs_captain(){
        return is_captain;
    }
    public void setIs_captain(boolean is_captain){
        this.is_captain = is_captain;
    }
    @Column(name="first_name")
    public String getFirst_name() {
        return first_name;
    }
    public void setFirst_name(String first_name) {
        this.first_name = first_name;
    }
    @Column(name="last_name")
    public String getLast_name() {
        return last_name;
    }
    public void setLast_name(String last_name) {
        this.last_name = last_name;
    }
//    @Column(name="id_group")
//    public  int  getIdGroup(){
//        return id_group;
//    }
//
//    public void setIdGroup(int id_group) {
//        this.id_group = id_group;
//    }
//    @Column(name="id_chair")
//    public  int  getIdChair(){
//        return id_chair;
//    }
//
//    public void setIdChair(int id_chair) {
//        this.id_chair = id_chair;
//    }



    @ManyToOne
    @JoinColumn(name="id_group")
    public Group getGroup(){
        return group;
    }

    public void setGroup(Group group){
        this.group = group;
    }

    @ManyToOne
    @JoinColumn(name="id_chair")
    public Chair getChair(){
        return chair;
    }
    public void setChair(Chair chair){
        this.chair = chair;
    }
    }
